<template>
  <div class="page">
    <heads></heads>
    <div class="page-content" style="width: 100%;background: #fff">
      <div class="formB">
        <form>
          <mt-field class="text-red" label="金额" disableClear :state="isName" v-model="moneys"    placeholder="输入提现金额" type="number"></mt-field>
        </form>
        <div class="form-control">
          <mt-button class="form-button default"  @click="getInfo()">提现</mt-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import heads from '../components/header'
  import { Loadmore,Toast ,MessageBox } from 'mint-ui';
  import MtButton from "../../node_modules/mint-ui/packages/button/src/button";
  export default {
    data(){
      return{
        moneys:[],
        isName:'',
        isMsg:'',
      }
    },
    mounted(){
    },
    methods:{

      getInfo(){
        const _this=this;
        if(!this.changeName()){
          MessageBox.alert(this.isMsg);
          return false
        }else {

          this.$http(this.API.applyCash, {
            data: {
              amount:_this.moneys
            }
          }).then(function (res) {
            MessageBox.alert(res.message);
          }).catch(function (err) {
            console.log(err);
          });
        }
      },
      changeName(){
        if(this.moneys==''){
          this.isName='warning';
          this.isMsg='请输入金额'
          return false
        }else{
          this.isName='success';
          return true
        }
      },
      
    },
    components: {
      MtButton,
      heads
    }

  }
</script>
<style>
  @import "../sass/pageScss/prize.scss";
</style>

